package com.ruoyi.bus.controller;

import com.ruoyi.util.TimeConversionUtil;
import com.ruoyi.websocket.ProductWebSocket;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.IOException;

@Controller
public class WebSocketTest {

    @RequestMapping("/websockeTestPage")
    public String testWebSocket(){
        return "webSocket/sendMessage";
    }

/*    @Scheduled(fixedRate = 10000)*/
    public void sendMess() throws IOException {
        int count=1;
        System.out.println("发送消息准备。。。。");
        ProductWebSocket.sendInfo(TimeConversionUtil.getTimeStrNow()+count++);
        System.out.println("发送成功。。。。。");
    }


}
